package cate.game.train.equip.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBTrain;
import easy.java.dev.note.NoteField;

import java.util.Set;

@ClientMsg(title = "超越装备合成 的请求")
@OperationSetter(value = GDOperation.OVERSTEP_EQUIP_COMPOSE, sub = "tid")
public class EquipOverstepReforgeReq implements MsgInput {
    @NoteField("要合成的装备tid")
    public int tid;

    @NoteField("消耗的装备uid们")
    public Set<String> equipUids;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = game.train.equip.forgeOverstepEquip(cc.getRole(), tid, equipUids);
        if (!r.ok()) {
            game.notice.message(cc.getRole(), r);
        }
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBTrain.EQUIP_OVERSTEP_FORGE_REQ;
    }
}
